package com.hiwan.unions.activity.base.mvpbase;

/**
 * Created by llg on 2017/9/25.
 */

import com.hiwan.unions.activity.base.RootActivity;

/**
 * Created by haorui on 2016/8/2.
 * MVP Fragment基类
 */
public abstract class BaseActivity<T extends BasePresenter> extends RootActivity implements BaseView {

    protected T mPresenter;

    @Override
    protected void onViewCreated() {
        super.onViewCreated();
        initInject();
        if (mPresenter != null)
            mPresenter.attachView(this);
    }

    @Override
    protected void onDestroy() {
        if (mPresenter != null)
            mPresenter.detachView();
        super.onDestroy();
    }
    protected abstract void initInject();
}